#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>

#define SIZE 1024
#define _FILE_MODE 0666

#define FFLUSH_NOW 1
#define FFLUSH_LINE 2
#define FFLUSH_ALL 4

typedef struct IO_FILE
{
	int fileno;
	int flag;
	//inputbuffer[SIZE];
	char outbuffer[SIZE];
	int out_pos;
}_FILE;

_FILE *_fopen(const char *filename, const char *flag);
int _fwrite(_FILE *filename, const char *s, int len);
void _fflush(_FILE *fp);
void _fclose(_FILE *fp);
